package com.chezhujie.www.enums;

import com.xy.core.init.mysql.annotation.Enum;

/**
 * Created by 汤伟杰 on 2017/6/27.
 */
@Enum(name="columntype" ,type = "select")
public enum Columntype {

    STRING("java.lang.String",1),INTEGER("java.lang.Integer",2),DATE("java.util.Date",3),BIGDECIMAL("java.math.BigDecimal",4);
    private String name;
    private int index;
    // 构造方法
    private Columntype(String name, int index) {
        this.name = name;
        this.index = index;
    }
    // 普通方法
    public static String getName(int index) {
        for (Columntype c : Columntype.values()) {
            if (c.getIndex() == index) {
                return c.name;
            }
        }
        return null;
    }
    // get set 方法
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public int getIndex() {
        return index;
    }
    public void setIndex(int index) {
        this.index = index;
    }

}
